package com.bwie.controller;
import com.bwie.pojo.Hotel;
import com.bwie.service.HotelService;
import com.bwie.service.Impl.HotelServiceImpl;
import com.bwie.utils.R;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_hotel)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/user/hotel")
public class HotelController {
/**
* 服务对象
*/
    @Autowired
    private HotelService hotelService;

    /**
     * 获取酒店信息
     * @return
     */
    @PostMapping("/getHotel")
    public R getHotel(){
        return hotelService.getHotel();
    }

    /**
     * 酒店编辑
     * @param hotel
     * @return
     */
    @PostMapping("/updateHotel")
    public R updateHotel(
        @RequestBody Hotel hotel
    ){
        return hotelService.updateHitel(hotel);
    }

    /**
     * id查询酒店
     * @param hotelId
     * @return
     */
    @PostMapping("/getHotelById/{hotelId}")
    public R getHotelById(
            @PathVariable("hotelId")Integer hotelId
            ){
        return hotelService.getHotelById(hotelId);
    }
}
